package com.oceansoft.core.jxkh.dao;

import com.oceansoft.core.common.util.Pagination;
import com.oceansoft.core.domain.SysUser;
import com.oceansoft.core.jxkh.domain.Khfk;
import com.oceansoft.core.jxkh.domain.Task;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by begcoffee on 2017/12/11.
 */
public interface ITaskDao {
    Pagination querybycondition(HashMap<String, String> map, SysUser user);
    void addTask(Task task) throws Exception;
    void saveTask(Task task) throws Exception;
    void deleteTask(Long dbid) throws Exception;
    int stopTask(Long dbid,String type) throws Exception;
    Task getTaskById(Long dbid) throws Exception;
    void saveKhfk(Khfk khfk) throws Exception;
    Khfk getKhfkById(Long dbid) throws Exception;

    /***
     * 查询需要结束的任务
     * @return
     * @throws Exception
     */
    List<Task> getEndingTask() throws Exception;
    /***
     * 查询需要开始的任务
     * @return
     * @throws Exception
     */
    List<Task> getStartingTask() throws Exception;
    void endTask(Task task) throws Exception;
    Task getNextTask(Task task) throws Exception;
    void updateTaskStatus(Task task) throws Exception;

    /***
     * 复制本次考核任务的考核关系到下次任务
     * @param curentTask
     * @param nextTask
     */
    void doCopyTaskRelation(Task curentTask,Task nextTask) throws Exception;

    /***
     * 初始化考评打分
     * @param task
     * @throws Exception
     */
    void initTaskMark(Task task) throws Exception;
}
